package com.capgemini.cn.authority.rest.valueobject.data;

import com.capgemini.cn.authority.data.entity.AssertsGroup;
import com.capgemini.cn.authority.data.entity.Authorities;
import com.capgemini.cn.authority.data.entity.AuthoritiesType;
import com.capgemini.cn.authority.data.entity.Roles;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.util.List;

/**
 * Created at 2017/10/31
 *
 * @author Andriy
 */
@ApiModel(value = "权限对象")
@JsonSerialize
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@NoArgsConstructor
public class PermissionVO extends Authorities {

    @JsonIgnore
    @Override
    public AuthoritiesType getAuthoritiesType() {
        return super.getAuthoritiesType();
    }

    @ApiModelProperty(value = "权限分类信息")
    @JsonProperty(value = "authoritiesType")
    public String getType() {
        return super.getAuthoritiesType().getTypeName();
    }

    @ApiModelProperty(value = "权限名称")
    @Override
    public String getAuthorityName() {
        return super.getAuthorityName();
    }

    @ApiModelProperty(value = "权限编码")
    @Override
    public String getAuthorityCode() {
        return super.getAuthorityCode();
    }

    @JsonIgnore
    @Override
    public List<Roles> getRoles() {
        return super.getRoles();
    }

    @JsonIgnore
    @Override
    public List<AssertsGroup> getAssertsGroups() {
        return super.getAssertsGroups();
    }

    @ApiModelProperty(value = "权限数据主键")
    @Override
    public long getId() {
        return super.getId();
    }

    @ApiModelProperty(value = "权限创建时间")
    @Override
    public Timestamp getCreateTime() {
        return super.getCreateTime();
    }

    @JsonIgnore
    @Override
    public Timestamp getUpdateTime() {
        return super.getUpdateTime();
    }
}
